#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* masterMind(char* solution, char* guess, int* returnSize) {
    int* answer = (int*)calloc(2, sizeof(int));
    int i = 0;
    int flag = 0;
    char* ret = solution;
    char* roc = guess;

    while (*ret)
    {
        if (*ret == *roc)
        {
            answer[0]++;
        }
        ret++;
        roc++;
    }
    int sum = 0;
    for (i = 0; i < 4; i++)
    {
        int j = 0;
        flag = 0;
        for (j = 0; j < 4; j++)
        {
            if (solution[j] == guess[i])
            {
                flag = 1;
                solution[j] = 0;
                break;
            }
        }
        if (flag == 1)
        {
            sum++;
        }
    }
    answer[1] = sum - answer[0];
    *returnSize = 2;
    return answer;
}

int main()
{
    return 0;
}